package com.online.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.online.entity.MultiQuestion;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface MultiQuestionMapper {
    /**
     * 增加选择题
     * @param multiQuestion
     * @return
     */
    @Options(useGeneratedKeys = true,keyProperty = "questionId")
    int add(MultiQuestion multiQuestion);

    /**
     * 查询最后一条记录的questionId
     * @return
     */
    MultiQuestion findOnlyQuestionId();

    List<MultiQuestion> findByIdAndType(Integer paperId);

    List<Integer> findBySubject(String subject, Integer changeNumber);
    @Select("select * from multi_question")
    IPage<MultiQuestion> findAll(Page page);
}
